﻿using System;
using GameStateManagement.Model.Physics.Interfaces;
using Microsoft.Xna.Framework;
using GameStateManagement.Model.Entities.Interfaces;
using System.Xml.Serialization;

namespace GameStateManagement.Model.Entities
{
    /// <summary>
    /// Entity base, other entites are derived from this.
    /// </summary>
    [XmlRootAttribute(ElementName = "EntityBase", IsNullable = false)]
    [XmlInclude(typeof(MovingEntity))]
    [XmlInclude(typeof(StaticEntity))]
    public abstract class EntityBase : IEntity, ICollidable
    {
        #region Fields

        #endregion

        #region Properties

        public String Name { get; set; }
        public Vector2 Facing { get; set; }
        public Vector2 Position { get; set; }
        public string TextureName { get; set; }
        public Color Color { get; set; }
        public Vector2 Scale { get; set; }
        public float Rotation { get; set; }

        #endregion

        #region Constructors

        protected EntityBase()
        { }

        protected EntityBase(Vector2 position, Vector2 facing, string textureName, Color color, Vector2 scale)
        {
            Facing = facing;
            Position = position;
            TextureName = textureName;
            Color = color;
            Scale = scale;
        }

        #endregion

        #region Public Methods

        public abstract void Update(GameTime gameTime);

        #endregion

        #region Lifetime methods

        #endregion

    }
}
